Skip to content

docs(website): docs architecture + theming section (docs PR 1 of 4) - #60

Merged
blove merged 12 commits into
mainfrom
feat/docs-architecture
May 2, 2026
Merged

blove merged 12 commits into
mainfrom
feat/docs-architecture

Conversation

@blove

@blove blove commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

First implementation PR of the pretable docs architecture arc. Replaces the 1-page `/docs` stub with a Theming section + supporting infrastructure. 9 new MDX pages, 1 nav extension, 1 /docs hub refresh.

After this PR, `pretable.ai/docs` has a real Theming section that documents the override story plus the wider theming surface. The asymmetry where `@pretable/ui`'s npm README was more thorough than the website docs is closed for theming.

What changed

  • Architecture spec (`docs/superpowers/specs/2026-05-02-pretable-docs-architecture-design.md`) — IA + content outlines for the full 25-page docs surface (PRs 1-4)
  • Implementation plan (`docs/superpowers/plans/2026-05-02-pretable-docs-pr1-theming.md`) — 11-task plan with verbatim content per page

Nav extension + /docs hub:

  • `apps/website/app/docs/_nav.ts` — extends from 1 section to 2 (Getting Started: 2 items, Theming: 8 items)
  • `apps/website/app/docs/page.mdx` — refreshed from 8-line stub into a section-card hub

9 new pages:

  • `apps/website/app/docs/getting-started/concepts/page.mdx` — mental-model overview (engine + theming + streaming layers)
  • `apps/website/app/docs/theming/page.mdx` — Theming Overview with ASCII-art layered diagram
  • `apps/website/app/docs/theming/pick-a-theme/page.mdx` — Excel vs Material 3 with import examples
  • `apps/website/app/docs/theming/override-tokens/page.mdx` — the override story with 4 worked examples
  • `apps/website/app/docs/theming/light-dark/page.mdx` — runtime light/dark switching (React state + OS-respect patterns)
  • `apps/website/app/docs/theming/density/page.mdx` — runtime density switching (compact/standard/spacious)
  • `apps/website/app/docs/theming/custom-themes/page.mdx` — author your own theme file from scratch
  • `apps/website/app/docs/theming/tailwind-css-in-js/page.mdx` — Tailwind v4 bridge + CSS-in-JS integration
  • `apps/website/app/docs/theming/token-reference/page.mdx` — canonical 24-token table

Conventions established

  • Frontmatter: `title` + `description` (YAML) — minimal for v0.0.x
  • Voice: third-person conversational, code-first recipes, honest about pre-1.0 status
  • MDX components: existing `` (shiki); markdown blockquotes for callouts (no `` component dependency)
  • Diagrams: ASCII-art for v0.0.x (chosen over inline SVG to avoid JSX-in-MDX complexity)
  • Cross-references: in-prose `/docs/...` links + "Where to go next" sections
  • One known gotcha: literal `` in YAML frontmatter is parsed by MDX as a JSX opening tag and breaks the build — the light-dark page's frontmatter says "the html element" instead. Body still uses `` correctly inside backticks.

What's deferred to subsequent docs PRs

  • PR 2 — Grid section: 5 pages (Overview, Columns, Rows/selection/focus, Sort+filter, Density helpers)
  • PR 3 — API Reference + Streaming stub + Examples gallery: 8 pages total
  • PR 4 — Polish + cross-references + package README updates

Test plan

  • `pnpm --filter @pretable/app-website test` — 51/51 passing (no regression)
  • `pnpm --filter @pretable/app-website typecheck` — passes
  • `pnpm --filter @pretable/app-website build` — passes; all 11 docs routes prerender as static
  • `pnpm exec prettier --check apps/website/app/docs` — all files clean
  • Visual sanity (reviewer): `pnpm --filter @pretable/app-website dev`, click through every theming page, verify ASCII-art diagram renders monospaced, code blocks have shiki highlighting, cross-references work

Commit narrative

12 commits, telling the story end-to-end:

  1. `docs(specs): pretable docs architecture design` — IA + content outlines (this brainstorm's spec)
  2. `docs(plans): pretable docs PR 1 — theming section + concepts` — implementation plan
  3. `docs(website): extend nav + refresh /docs hub for theming section`
  4. `docs(website): add Getting Started > Concepts page`
  5. `docs(website): add Theming Overview (concept page)`
  6. `docs(website): add Theming > Pick a theme (recipe)`
  7. `docs(website): add Theming > Override tokens (the override story)`
  8. `docs(website): add Theming > Light / dark switching (recipe)`
  9. `docs(website): add Theming > Density switching (recipe)`
  10. `docs(website): add Theming > Custom themes (recipe)`
  11. `docs(website): add Theming > Tailwind v4 + CSS-in-JS (recipe)`
  12. `docs(website): add Theming > Token reference (canonical 24-token table)`

Each implementation commit ships one user-visible page; each is independently bisect-safe.

blove and others added 12 commits May 2, 2026 07:32
25-page documentation site for pretable.ai/docs to replace the current
1-page stub. Topical IA with Diátaxis-hybrid shape (concept → recipes
→ reference) per section. Six top-level sections: Getting Started,
Theming, Grid, Streaming (stub for v0.0.x), API Reference, Examples.

Resolves the asymmetry where the @pretable/ui package README is more
thorough than the website docs by lifting README content into a
structured docs site and expanding it.

IA aligns with user's other repos (angular-agent-framework, dawn —
both use Getting Started / Concepts / Guides / Reference shape, both
Next.js + MDX). Aligns with field conventions: Tailwind's "concept
hub + token reference + escape hatch" pattern for theming, shadcn's
CSS-variable contract pattern, AG Grid's per-feature concept→reference
depth.

Decomposed into 4 implementation PRs:
- PR 1: Theming section + Concepts page + nav extension + /docs hub
  (the override story you flagged + supporting infrastructure)
- PR 2: Grid section
- PR 3: API Reference + Streaming stub + Examples gallery
- PR 4: Polish + cross-references + package README updates

Hand-authored MDX, third-person voice, code-first recipes. No
auto-generation for v0.0.x. Reuses existing Callout + CodeBlock
components from apps/website. One inline SVG architecture diagram on
Theming Overview. Custom theme + Streaming examples deferred from
v0.0.x until their authoring stories stabilize.

Each PR gets its own writing-plans cycle when its turn comes. PR 1
starts immediately after this spec is approved.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
11-task plan covering the 9 new MDX pages + nav extension + /docs
index hub refresh:

- Task 1: Extend _nav.ts (1 section → 2) + refresh /docs hub
- Task 2: Getting Started > Concepts page (mental-model overview)
- Task 3: Theming Overview (concept page, ASCII-art layered diagram)
- Task 4: Theming > Pick a theme (Excel vs Material 3)
- Task 5: Theming > Override tokens (the override story)
- Task 6: Theming > Light / dark switching
- Task 7: Theming > Density switching
- Task 8: Theming > Custom themes
- Task 9: Theming > Tailwind v4 + CSS-in-JS
- Task 10: Theming > Token reference (canonical 24-token table)
- Task 11: Final verification (build + test + typecheck + prettier
  + visual sanity)

Each MDX page has full content inline so the implementer subagent
can transcribe rather than author. Prettier discipline on every
commit step. ASCII-art diagram chosen over inline SVG to avoid
JSX-in-MDX complexity for v0.0.x.

Decided to drop the empty-sections-in-nav approach: Grid /
Streaming / API Reference / Examples sections are added in PR 2 /
PR 3 of the docs arc when their content lands. Sidebar feels
"complete" via the /docs index hub's "Coming soon" copy.

10-11 commits in this PR depending on whether the spec/plan commits
count. Each commit ships one user-visible page.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Extends apps/website/app/docs/_nav.ts from one section (Getting
Started) to two (Getting Started, Theming). Adds the 8 theming
nav entries pointing at pages that subsequent commits in this PR
create. Also adds the Concepts entry under Getting Started.

Refreshes apps/website/app/docs/page.mdx from the prior 8-line
stub into a section-card hub. The hub describes the documented
sections (Getting Started, Theming) + the deferred ones (Grid,
Streaming, API Reference, Examples — landing in subsequent docs
PRs). Honest about coverage rather than promising more than ships.

Part 1 of pretable docs PR 1 (theming section + concepts). The
content pages land in subsequent commits in this PR; the build
passes here because Next.js doesn't validate href targets at
build time.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
One-page mental-model overview of pretable's three-layer architecture:
engine (@pretable/react), theming layer (@pretable/ui), streaming
(deferred for v0.0.x). Documents the two-namespace coexistence
pattern, the three runtime axes (theme, density, light/dark), and
the pre-1.0 instability caveat.

Cross-links to Theming Overview, Override tokens, Token reference,
and the streaming overview (lands in PR 3 of the docs arc).

Part 2 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
The theming model documented as three cooperating CSS layers:
theme tokens (Layer 1), grid.css chrome selectors (Layer 2),
consumer overrides (Layer 3). Includes an ASCII-art layered
diagram (no SVG dependency) showing how the layers compose.

Documents the 24-token contract grouped by purpose, the two
attribute axes (data-theme, data-density), and the cascade order
that resolves when consumer overrides + dark mode + density
combine.

Cross-links to all 7 theming sub-pages plus the Token reference.

Part 3 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Side-by-side description of Excel and Material 3 themes: visual
identity, when to use each, import statements. Excel: gray/technical/
dense, light-only, Aptos Narrow 11pt, Excel-green active cell.
Material 3: baseline scheme #6750A4, Roboto Flex, light + dark,
12dp medium shape, M3 surface tones.

Build-time switch is a single import swap. Cross-links to override
tokens, light/dark, density, custom themes.

Part 4 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
The override pattern explained: redefine --pretable-* values in
your :root, cascade source-order wins because your stylesheet
loads after the theme. No rebuild, no fork.

Four worked examples: tweak one accent (brand alignment), swap
entire palette (effectively a custom theme on top of Excel), change
corner radius, override density values. Plus token-group taxonomy
(surfaces / text / lines / state / accent / density / typography)
and specificity tips.

This is the "override story" the user flagged needs to be in /docs.

Part 5 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Two patterns: React state-driven (user toggle button) and OS-respect
(prefers-color-scheme media query). Both wire data-theme="dark" on
<html> via a useEffect. Excel is light-only — flagged with a
blockquote pointing at custom themes for consumers who need dark
on Excel.

Documents independent composition with data-density attribute and
SSR considerations (cookie vs client-only).

Part 6 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Three-tier density toggle (compact / standard / spacious) wired via
data-density attribute. Documents the per-theme natural default
(Excel compact, Material standard), the engine bridge through
useResolvedHeights + MutationObserver, prop-level override pattern,
composition with light/dark, and a localStorage persistence example.

Part 7 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Authoring a theme file from scratch: copy excel.css or material.css
as a template, define all 24 --pretable-* tokens at :root, optionally
add [data-theme="dark"] for dark mode and [data-density="..."] for
non-default density tiers. Full code example for a custom brand
theme. When-to-use table comparing override-at-:root vs. custom
theme file vs. both.

Part 8 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Two integration paths documented in one page (combined for v0.0.x;
can split later if either grows).

Tailwind v4: opt-in @pretable/ui/tailwind.css import registers
--color-pt-* / --font-pt-* shortcuts via @theme. Utilities like
bg-pt-bg-grid, text-pt-accent, font-pt-mono. Density and radius
intentionally excluded (no per-element utility analog).

CSS-in-JS: var(--pretable-*) works directly in styled-components,
emotion, vanilla-extract, etc. Runtime resolution means tokens
automatically reflect active theme + density + dark mode.

Part 9 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Full reference for @pretable/ui's public theming contract. 24
tokens grouped: Surfaces (5), Text (3), Lines (3), State (4),
Accent (1), Density (6), Typography (2). Each row: name,
description, type (color / length / font), example value in Excel
+ Material 3 (light).

Density tokens marked "engine reads?" — only --pretable-row-height
and --pretable-header-height are read by JS; the other 22 are
CSS-only.

Plain markdown table for v0.0.x. If the contract grows past 30+
tokens later, upgrade to a sortable/filterable component.

Stability disclaimer documents the pre-1.0 token-rename freedom.

Part 10 of pretable docs PR 1.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
pretable Ignored Ignored May 2, 2026 3:23pm

Request Review

@blove
blove enabled auto-merge (squash) May 2, 2026 15:23
@blove
blove merged commit 519ef1b into main May 2, 2026
10 checks passed
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Vercel preview ready

Preview: https://pretable-p8a3frvys-cacheplane.vercel.app
Commit: 44ea62ba2da74c6a8033f27bf322155748166211

Updated automatically by the deploy-preview job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant